package com.yyfax.pay.common.model.vo;

/**
 * 参数校验结果实体
 * 
 * @author buyi
 * @date 2017-09-18 17:16:02
 * @since v2.0.0
 */
public class ValidResult {
	private boolean isOk;
	private String errMsg;
	private Integer errCode;
	/** 扩展字段*/
	private String ext;

	public ValidResult(boolean isOk) {
		super();
		this.isOk = isOk;
	}

	private ValidResult(boolean isOk, String errMsg) {
		super();
		this.isOk = isOk;
		this.errMsg = errMsg;
	}

	public static ValidResult newInstance(boolean isOk) {
		return new ValidResult(isOk);
	}

	public static ValidResult newInstance(boolean isOk, String errMsg) {
		return new ValidResult(isOk, errMsg);
	}

	/**
	 * 判断校验结果
	 * 
	 * @author buyi
	 * @date 2017-09-18 16:59:53
	 * @since v2.0.0
	 * @return true表示校验通过，false表示校验不通过
	 */
	public boolean isOk() {
		return isOk;
	}

	/**
	 * 获取错误信息描述
	 * 
	 * @author buyi
	 * @date 2017-09-18 17:17:29
	 * @since v2.0.0
	 * @return
	 */
	public String getErrMsg() {
		return errMsg;
	}

	public Integer getErrCode() {
		return errCode;
	}

	public ValidResult errMsg(String errMsg) {
		this.errMsg = errMsg;
		return this;
	}

	public ValidResult errCode(Integer errCode) {
		this.errCode = errCode;
		return this;
	}
	
	public ValidResult ext(String ext) {
		this.ext = ext;
		return this;
	}
	

	public String getExt() {
		return ext;
	}
}
